package easyexcel

// ToBean 构建excel转化bean的对象
func ToBean[T any]() ReadExcel[T] {
	e := new(excelToBean[T])
	e.easyExcel = new(easyExcel[T])
	e.initEasyExcel()
	return e
}

// ToExcel 构建bean转化excel的对象
func ToExcel[T any]() WriteExcel[T] {
	e := new(beanToExcel[T])
	e.easyExcel = new(easyExcel[T])
	e.initEasyExcel()
	return e
}

// ToBeanStream 构建excel转化bean的流对象，可以处理大数据，从而避免内存溢出
func ToBeanStream[T any]() ReadExcelStream[T] {
	e := new(excelToBeanStream[T])
	e.easyExcel = new(easyExcel[T])
	e.initToBeanStream()
	return e
}

// ToExcelStream 构建bean转化excel的流对象，可以处理大数据，从而避免内存溢出
func ToExcelStream[T any]() WriteExcelStream[T] {
	e := new(beanToExcelStream[T])
	e.easyExcel = new(easyExcel[T])
	e.initEasyExcel()
	return e
}
